<?php
include("../admin/cls/cls_user.php");
include("../admin/cls/sesion.php");
session_start();
if(!$_SESSION[""]->nombre)
	{
		header("Location:index.html");
	}
 $user_id=$_SESSION[""]->id;
?>
<html>
<!--  <script src="../js/chat.js" type="text/javascript"></script>-->	
	<body onLoad="javascript:startChat(<?php echo $user_id ?>);">
		
		<div id="div_chat"  style="height: 353px; width: 320px; overflow: auto; background-color: #ffffff; border: 0px solid #000000;">
			<table>
			<tr>
				<td>
					<?php echo $_SESSION[""]->nombre ?>
				</td>
			</tr>
				<tr>
					<td>
					<textarea disabled id="message_chat" name="message_chat" rows="18" readonly cols="20" style="width: 300px;" >
					</textarea>
				</td>
				</tr>
				</table>
		</div>
			
		<div id="div_chat_controls"  style="height: 150px; width: 320px; overflow: auto; background-color: #ffffff; border: 0px solid #000000;">
		<form id="frmmain" name="frmmain" onSubmit="return blockSubmit(<?php echo $user_id ?>);">
		<table>
			<tr>
				<td>
					<input type="button" name="btn_get_chat" id="btn_get_chat" value="Refresh Chat" onClick="javascript:getChatText(<?php echo $user_id ?>);" />
					<input type="button" name="btn_reset_chat" id="btn_reset_chat" value="Reset Chat" onClick="javascript:resetChat();" /><br />
				</td>
			</tr>
			<tr>
				<td>
					<textarea onkeypress="ifEnter(this,event);"  id="txt_message" name="txt_message" style="width: 300px;" /></textarea>
				<td>
			</tr>
			<tr>
				<td align="right">
					<input align="right" type="button" name="btn_send_chat" id="btn_send_chat" value="Send" onClick="javascript:sendChatText(<?php echo $user_id ?>);" />
				</td>
		    </tr>
	</table>
		</form>
		</div>
	</body>
	
</html>